From: Philip Chimento Date: Fri, 25 Oct 2019 22:27:25 +0000 (-0700) Subject: appDisplay: Don't crash if app is missing categories X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~499 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0732e1426a6cc0fe50a7fdb84d4b633faba3dbe8;p=gnome-shell.git appDisplay: Don't crash if app is missing categories g_desktop_app_info_get_categories() may return null. In that case, the previous code would fail to create a folder when dragging an app with no categories onto another app. Instead, simply continue with the next app info. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/782 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 79c2f7e83..68dbb7f87 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -98,7 +98,10 @@ function _findBestFolderName(apps) { let commonCategories = []; appInfos.reduce((categories, appInfo) => { - for (let category of appInfo.get_categories().split(';')) { + const appCategories = appInfo.get_categories(); + if (!appCategories) + return categories; + for (let category of appCategories.split(';')) { if (!(category in categoryCounter)) categoryCounter[category] = 0;